package com.seo.proxy.context;

import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

import com.seo.async.HasClientContext;
import com.seo.async.SocketContext;

public class ResponseContext implements SocketContext, HasClientContext {

	private boolean proxyRequestSent = false;

	private boolean proxyResponseReceived = false;

	private SocketChannel socketChannel;

	private ByteBuffer proxyRequestBuffer;

	private ClientContext clientContext;

	public ResponseContext(ClientContext clientContext) {
		this.clientContext = clientContext;
	}

	public ResponseContext(ClientContext clientContext, SocketChannel socketChannel) {
		this.socketChannel = socketChannel;
		this.clientContext = clientContext;
	}

	@Override
	public ClientContext getClientContext() {
		return clientContext;
	}

	public ByteBuffer getProxyRequestBuffer() {
		return proxyRequestBuffer;
	}

	public void setProxyRequestBuffer(ByteBuffer proxyRequestBuffer) {
		this.proxyRequestBuffer = proxyRequestBuffer;
	}

	public SocketChannel getSocketChannel() {
		return socketChannel;
	}

	@Override
	public void setSocketChannel(SocketChannel socketChannel) {
		this.socketChannel = socketChannel;
	}

	public boolean isProxyRequestSent() {
		return proxyRequestSent;
	}

	public void setProxyRequestSent(boolean proxyRequestSent) {
		this.proxyRequestSent = proxyRequestSent;
	}

	public boolean isProxyRequestDone() {
		return proxyResponseReceived;
	}

	public void setProxyRequestDone(boolean proxyRequestDone) {
		this.proxyResponseReceived = proxyRequestDone;
	}
}
